﻿// -----------------------------------------------------------------------
// <copyright file="TaskManagerService.cs" company="Microsoft">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

using System.Threading;

namespace DemoService
{
    public class TaskManagerService : ITaskManagerService
    {
        public LoginResult Login(string username, string password)
        {
            this.Process();
            if("letuan".Equals(username) && "123".Equals(password))
                return LoginResult.Succeeded;
            return LoginResult.Failed;
        }

        public ProcessQueryResult ProcessQuery(bool expectedVal)
        {
            this.Process();
            return expectedVal ? ProcessQueryResult.Succeeded : ProcessQueryResult.HasErrors;
        }

        private void Process()
        {
            Thread.Sleep(2000);
        }
    }
}
